package vn.vfriends.vbox.interceptor;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author tuancn
 */
public class LoggingInterceptor {
    
    private static final Logger logger = LoggerFactory.getLogger(LoggingInterceptor.class);
    
    @AroundInvoke
    public Object logCallingMethod(InvocationContext context) throws Exception {
        logger.debug("Calling method {} with parameters {}", context.getMethod().toGenericString(), context.getParameters());
        return context.proceed();
    }
}
